import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

import path from "path";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname,'./src') 
    },
    extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
  },
  server:{
    port:5275,
    host:'0.0.0.0',
    proxy: {
      '/project': {
        target: 'http://localhost:8080', // 后端服务器地址
        changeOrigin: true, // 是否改变源
        // rewrite: (path) => path.replace(/^\/project/, '') // 替换路径
      }

    }
  }
})
